;Segment Attribute
DA_32   equ 0x4000
DA_DR   equ 0x90
DA_DRW  equ 0x92
DA_DRWA equ 0x93
DA_C    equ 0x98
DA_CR   equ 0x9A
DA_CCO  equ 0x9C
DA_CCOR equ 0x9E

;special Attribute
DA_LDT equ 0x82;局部段描述符表

;Selector Attribute
SA_RPL0   equ  0
SA_RPL1   equ  1
SA_RPL2   equ  2
SA_RPL3   equ  3

SA_TIG    equ  0
SA_TIL    equ  4


;descriptor
;usage: Descriptor Base,Limit,Attr
;Base: dd
;Limit  dd(low 20 bits available)
;Attr: dw(lower 4 bits of higher byte are always 0)
%macro Descriptor 3  ;base limit attr
  dw %2 & 0xFFFF ;limit 1
  dw %1 & 0xFFFF
  db (%1 >> 16)&0xFF
  dw ((%2>>8)&0xF00) | (%3 & 0xF0FF)
  db (%1 >> 24) & 0xFF
%endmacro

